<include file="Public:header" />
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/goodsupload/swfupload.queue.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/goodsupload/fileprogress.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/goodsupload/handlers.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
	//编辑器
	KE.show({
		id : 'info',
		//imageUploadJson : 'index.php?m=attachment&a=keupload',
		//fileManagerJson : 'index.php?m=attachment&a=file_manager&',
		allowFileManager : true,
		afterCreate : function(id) {
			KE.event.ctrl(document, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
			KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
		}
	});
</script>

<form action="{:u('article/insert')}" method="post" name="myform" id="myform"  enctype="multipart/form-data">
  <div class="pad-10">
    <div class="col-tab">
      <ul class="tabBut cu-li">
        <li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',2,1);">{$Think.lang.general_info}</li>
        <li id="tab_setting_2" onclick="SwapTab('setting','on','',2,2);">{$Think.lang.article_seo}</li>
      </ul>
      <div id="div_setting_1" class="contentList pad-10">
        <table width="100%" cellpadding="2" cellspacing="1" class="table_form">
          <tr>
            <th width="150">{$Think.lang.article_title} :</th>
            <td><input type="text" name="title" id="title" class="input-text" size="60" value="{$article.title}"></td>
          </tr>
          <tr>
            <th>{$Think.lang.article_cate} :</th>
            <td><select name="cate_id" id="CATE_ID">
            	<option value="0">--请选择分类--</option>
                <volist name="cate_list['parent']" id="val">
                  <option value="{$val.id}">{$val.name}</option>
                  <notempty name="cate_list['sub'][$val['id']]">
                    <volist name="cate_list['sub'][$val['id']]" id="sval">
                      <option value="{$sval.id}">&nbsp;&nbsp;&nbsp;&nbsp;{$sval.name}</option>
                      <notempty name="cate_list['sub'][$sval['id']]">
                        <volist name="cate_list['sub'][$sval['id']]" id="ssval">
                          <option value="{$ssval.id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$ssval.cate_name}</option>
                        </volist>
                      </notempty>
                    </volist>
                  </notempty>
                </volist>
              </select></td>
          </tr>
          <tr>
            <th>{$Think.lang.sort} :</th>
            <td><input type="text" name="ordid" id="ordid" class="input-text" size="8"></td>
          </tr>
          <tr>
        <th>{$Think.lang.recommend} :</th>
        <td><input type="radio" name="recommend" class="radio_style" value="1" > &nbsp;已推荐&nbsp;&nbsp;&nbsp;
          <input type="radio" name="recommend" class="radio_style" value="0" checked="checked"> &nbsp;未推荐&nbsp;&nbsp;&nbsp; </td>
      </tr>
      <tr>
        <th>{$Think.lang.status} :</th>
        <td><input type="radio" name="status" class="radio_style" value="1">
          &nbsp;已审核&nbsp;&nbsp;&nbsp;
          <input type="radio" name="status" class="radio_style" value="0" checked="checked">
          &nbsp;未审核&nbsp;&nbsp;&nbsp; </td>
          </tr>
          <tr>
            <th>{$Think.lang.article_abst} :</th>
            <td><textarea name="abst" id="abst" style="width:68%;height:50px;"></textarea></td>
          </tr>
           <tr>
            <th>{$Think.lang.article_content} :</th>
            <td><textarea name="info" id="info" style="width:70%;height:350px;visibility:hidden;"></textarea></td>
          </tr>
        </table>
      </div>
      <div id="div_setting_2" class="contentList pad-10 hidden">
        <table width="100%" cellpadding="2" cellspacing="1" class="table_form">
          <tr>
            <th width="100">{$Think.lang.seo_title} :</th>
            <td><input type="text" name="seo_title" id="seo_title" class="input-text" size="60"></td>
          </tr>
          <tr>
            <th>{$Think.lang.seo_keys} :</th>
            <td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="60"></td>
          </tr>
          <tr>
            <th>{$Think.lang.seo_desc} :</th>
            <td><textarea name="seo_desc" id="seo_desc" cols="80" rows="8"></textarea></td>
          </tr>
        </table>
      </div>
      <div class="bk15"></div>
      <div class="btn"><input type="submit" value="{$Think.lang.submit}" onclick="return submitFrom();" name="dosubmit" class="button" id="dosubmit"></div>
    </div>
  </div>
</form>
<script type="text/javascript">
function SwapTab(name,cls_show,cls_hide,cnt,cur){
    for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}

function submitFrom(){
	if($("#CATE_ID").val()==0)
	{
	   alert('请选择文章分类');
	   return false;
	}

}
</script>
</body></html>